package com.nce.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.nce.entity.account.User;

/**
 * 用户最后检查时间
 * 
 * @author GT
 */
@Entity
@Table(name = "user_last_check_time")
// 默认的缓存策略.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class UserLastCheckTime extends IdEntity {

	private static final long serialVersionUID = 7589108853815428562L;
	/*
	CREATE TABLE `user_last_check_time` (
  `id` mediumint(9) NOT NULL AUTO_INCREMENT,
  `uid` mediumint(9) DEFAULT NULL COMMENT '新闻最后查看时间',
  `news_time` timestamp NULL DEFAULT NULL,
  `bbs_blog_time` timestamp NULL DEFAULT NULL COMMENT '论坛最后查看时间',
  `mblog_time` timestamp NULL DEFAULT NULL COMMENT '微博最后查看时间',
  `utime` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '本记录最后更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
	*/

	private User user;
	private Date newsTime;
	private Date bbsBlogTime;
	private Date mblogTime;
	private Date loginTime;

	@ManyToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name = "uid")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	
	
	

	public Date getLoginTime() {
		return loginTime;
	}

	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}

	public Date getNewsTime() {
		return newsTime;
	}

	public void setNewsTime(Date newsTime) {
		this.newsTime = newsTime;
	}

	public Date getBbsBlogTime() {
		return bbsBlogTime;
	}

	public void setBbsBlogTime(Date bbsBlogTime) {
		this.bbsBlogTime = bbsBlogTime;
	}

	public Date getMblogTime() {
		return mblogTime;
	}

	public void setMblogTime(Date mblogTime) {
		this.mblogTime = mblogTime;
	}

	

}
